package com.xyz.someapp;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.DeclareParents;

@Aspect
public class UsageTracking {
    public UsageTracking() {
        System.out.println("UsageTracking create..");
    }

  @DeclareParents(value="com.xzy.someapp.*+",
                  defaultImpl=DefaultUsageTracked.class)
  public static DefaultUsageTracked mixin;
  
  @Before("com.xyz.someapp.SystemArchitecture.dataAccessOperation() &&" +
          "this(usageTracked)")
  public void recordUsage(DefaultUsageTracked usageTracked) {
    usageTracked.incrementUseCount();
  }
  
}